function UserException (value) {
  this.value = value
  this.toString = function () {
    return this.value
  }
}

const Util = {//long类型date转换成时间日期格式
  dateFormat: function (longTypeDate,isFull) {
    var dateType = "";
    var date = new Date();
    date.setTime(longTypeDate);
    dateType += date.getFullYear();  //年
    dateType += "-" + this.getMonth(date); //月
    dateType += "-" + this.getDay(date);  //日
    if (isFull) {
      dateType += ' ' + (date.getHours() < 10 ? "0" + date.getHours() : date.getHours());
      dateType += ':' + (date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes());
      dateType += ':' + (date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds());
    }
    return dateType;
  },
  getMonth(date) {
    var month = "";
    month = date.getMonth() + 1; //getMonth()得到的月份是0-11
    if(month<10){
      month = "0" + month;
    }
    return month;
  },
  getDay(date) {
    var day = "";
    day = date.getDate();
    if(day<10){
      day = "0" + day;
    }
    return day;
  }
}
// const imageUrl = 'http://qqc.hztangong.com'
export default Util

